
#include "VertKinds.h"

IDirect3DVertexDeclaration9* g_VertPosClr = nullptr;
IDirect3DVertexDeclaration9* g_VertPosTex = nullptr;

void InitVertKinds(void)
{
	D3DVERTEXELEMENT9 VertPosClr[] = // define all components of one vertex 
	{
		// stream, offset, type, method, usage, usageIndex 
		{0, 0,  D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, // position
		{0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, // color
		D3DDECL_END() // ends the vertex declaration
	};
	g_VertPosClr = RENDERER->CreateVertexDeclaration(VertPosClr);

	D3DVERTEXELEMENT9 VertPosTex[] = // define all components of one vertex 
	{
		// stream, offset, type, method, usage, usageIndex 
		{0, 0,  D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, // position
		{0, 12, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0}, // texture
		D3DDECL_END() // ends the vertex declaration
	};
	g_VertPosTex = RENDERER->CreateVertexDeclaration(VertPosTex);
}